//---------------------------------------------------------------------------
#ifndef CDBLkcbH
#define CDBLkcbH
//---------------------------------------------------------------------------
#include "CtrlDB.h"
#include <SysUtils.hpp>
#include <Controls.hpp>
#include <Classes.hpp>
#include <Forms.hpp>
#include <DBCtrls.hpp>
#include "eic.h"
#include <map>
//---------------------------------------------------------------------------
class PACKAGE_CTRLDB CDBLookupComboBox : public TDBLookupComboBox
{
private:
  AnsiString  m_Libelle;
  bool        m_Enabled,m_Visible;
  bool        m_ReadOnly;
  TColor      m_Color;
  TFont      *m_Font;
  int         m_SizeEspace;
  TLabel     *m_Label;
  TFont      *m_LibelleFont;
  bool        m_bBoomCrash;

  void __fastcall SetEnabled     (bool       value);
  void __fastcall SetVisible     (bool       value);
  void __fastcall SetReadOnly    (bool       value);
  void __fastcall SetColor       (TColor     value);
  void __fastcall SetFont        (TFont     *value);
  void __fastcall SetLibelleFont (TFont     *value);
  void __fastcall SetLibelle     (const AnsiString value);
  void __fastcall SetSizeEspace  (int        value);

  void __fastcall SetLibellePos(void);
  void __fastcall SetLibelleFontChange(TObject *Sender);

  void __fastcall EvOnChange (TObject *Sender);

protected:
  void __fastcall WMPaint    (TWMPaint     &Msg);
  void __fastcall WMSetFocus (TWMSetFocus  &Msg);
  void __fastcall WMKillFocus(TWMKillFocus &Msg);
  void __fastcall WMWindowPosChanged(TWMWindowPosChanged &Msg);
  BEGIN_MESSAGE_MAP
   MESSAGE_HANDLER(WM_PAINT    , TWMPaint    , WMPaint    )
   MESSAGE_HANDLER(WM_SETFOCUS , TWMSetFocus , WMSetFocus )
   MESSAGE_HANDLER(WM_KILLFOCUS, TWMKillFocus, WMKillFocus)
   MESSAGE_HANDLER(WM_WINDOWPOSCHANGED, TWMWindowPosChanged, WMWindowPosChanged)
  END_MESSAGE_MAP(TDBLookupComboBox)

public:
  __fastcall  CDBLookupComboBox(TComponent* Owner);
  virtual __fastcall ~CDBLookupComboBox(void);
__published:
  __property TColor      Color        = { read=m_Color       , write=SetColor       , default=clWindow };
  __property bool        Enabled      = { read=m_Enabled     , write=SetEnabled     , default=true     };
  __property bool        Visible      = { read=m_Visible     , write=SetVisible     , default=true     };
  __property TFont      *Font         = { read=m_Font        , write=SetFont                           };
  __property AnsiString  Libelle      = { read=m_Libelle     , write=SetLibelle                        };
  __property TFont      *LibelleFont  = { read=m_LibelleFont , write=SetLibelleFont                    };
  __property bool        ReadOnly     = { read=m_ReadOnly    , write=SetReadOnly    , default=false    };
  __property int         SizeEspace   = { read=m_SizeEspace  , write=SetSizeEspace  , default=10       };
};
//---------------------------------------------------------------------------
#endif
